package com.v5ba.annotation.demo;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
@Slf4j
public class AopPath {
    @Pointcut("execution(* com.v5ba.annotation.web.*.*(..))")
    public void pointCut(){}

    @Before(value = "pointCut()")
    public void before(JoinPoint joinPoint){
        log.info("执行方法前调用");
        Object[] args = joinPoint.getArgs();
        args[1]="40";
        log.info("请求参数：{}", args.toString());
    }
}
